package neu.soft.controller;

import neu.soft.entity.FinancialPurchaseOrder;
import neu.soft.entity.OperationPurchaseOrder;
import neu.soft.query.PurchaseOrderQuery;
import neu.soft.service.PurchaseService;
import neu.soft.vo.PageBean;
import neu.soft.vo.ResultBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/purchase")
@CrossOrigin
public class PurchaseController {


    @Autowired
    PurchaseService purchaseService;

    @PostMapping
    public void purchase(@RequestBody OperationPurchaseOrder operationPurchaseOrder) {

    }

    @PostMapping("/page")
    public ResultBean<PageBean<FinancialPurchaseOrder>> findBypage(@RequestBody PurchaseOrderQuery purchaseOrderQuery) {
        PageBean<FinancialPurchaseOrder> pageBean = purchaseService.findByPage(purchaseOrderQuery);
        return ResultBean.success(pageBean);
    }
}
